package ru.classbase.dbdumper

import org.springframework.boot.CommandLineRunner
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.boot.runApplication

@SpringBootApplication
@EnableConfigurationProperties(AppProperties::class)
class DbDumpApplication(private val dumpManager: DumpManager) : CommandLineRunner {

    override fun run(vararg args: String?) {
        dumpManager.run()
    }

    companion object {
        @JvmStatic
        fun main(args: Array<String>) {
            runApplication<DbDumpApplication>(*args)
        }
    }

}